/*
 *  $Id: CloudDragon.cs 1051 2010-05-18 22:10:41Z thenn.erannor $
 *  This file is a part of Ragima CCG.
 *  (C) 2008 Ragima development group.
 *
 *  Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Air.Creatures {
    public class CloudDragon: CreatureCard {
        public CloudDragon(): base("001_a_c_cloud_dragon") {
            Level = CompleteLevel.ReadyForTest;
            Element = ElementType.Air;
            Value = 100;
            SetRace<Races.Dragon>();
            Damage = 5;
            Health = 7;
            AddManaCost(ElementType.Air, 15);
        }
        public override void SetNaturalAffects(ICollector<Affect> affects) {
            affects.Add<Affects.Flight>();
            affects.Add<CloudDragonGrowth>();
        }

        private class CloudDragonGrowth: Affect {
            public CloudDragonGrowth() {}

            public override string Id {
                get { return AffectManager.GetCardId<CloudDragon>("growth"); }
            }

            public override void SetAffect() {
                base.SetAffect();
                GlobalSummary.OnLandSummon += DoGrowth;
            }
            public override void ResetAffect() {
                base.SetAffect();
                GlobalSummary.OnLandSummon -= DoGrowth;
            }

            private void DoGrowth(Land land) {
                if (land.Card.Element == ElementType.Air) {
                    LocalSummary.ChangeDamage(1);
                }
            }
        }
    }
}
